package com.aep.ProjetoAnalise;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.util.ArrayList;

/*
Main - Classe de entrada do programa. Responsavel pela seleção de modalidade
 */
public class MainScreen extends Activity {
    /**
     * Declaração dos Arrays Contendo as fontes de notícias
     */
    private ArrayList<String> moba = new ArrayList<String>();
    private ArrayList<String> rts = new ArrayList<String>();
    private ArrayList<String> fight = new ArrayList<String>();
    private ArrayList<String> fps = new ArrayList<String>();
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //Carrega as fontes de um arquivo na memória interna em um ArayList


        //Teste: passando as strings para o array
        moba.add("http://www.teamliquid.net/rss/news.xml");
        rts.add("http://feeds.feedburner.com/starcraft");
        fight.add("http://shoryuken.com/feed/");
        fps.add("http://news.esea.net/csgo/index.php?s=news&d=rss");
        //Fim do teste

        Button mobaBtn = (Button) findViewById(R.id.mobaBtn);
        mobaBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainScreen.this, TabHostActivity.class);
                //Fontes de Noticias da Modalidade
                i.putExtra("nome", "MOBA");
                i.putStringArrayListExtra("fontes", moba);
                startActivity(i);
            }
        });

        Button rtsBtn = (Button) findViewById(R.id.rtsBtn);
        rtsBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainScreen.this, TabHostActivity.class);
                //Fontes de Noticias da Modalidade
                i.putExtra("nome", "RTS");
                i.putStringArrayListExtra("fontes", rts);
                startActivity(i);
            }
        });

        Button fightBtn = (Button) findViewById(R.id.fightBtn);
        fightBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainScreen.this, TabHostActivity.class);
                //Fontes de Noticias da Modalidade
                i.putExtra("nome", "FIGHTING");
                i.putStringArrayListExtra("fontes", fight);
                startActivity(i);
            }
        });

        Button fpsBtn = (Button) findViewById(R.id.fpsBtn);
        fpsBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainScreen.this, TabHostActivity.class);
                //Fontes de Noticias da Modalidade
                i.putExtra("nome", "FPS");
                i.putStringArrayListExtra("fontes", fps);
                startActivity(i);
            }
        });
    }
}
